@using OrchardCore.ContentManagement
@using OrchardCore.Forms.Models;
@using OrchardCore.Mvc.Utilities;
@using Newtonsoft.Json.Linq;

@inject OrchardCore.ContentManagement.Display.IContentItemDisplayManager ContentItemDisplayManager

@{
    var formPart = ((ContentItem)Model.ContentItem).As<FormPart>();
    string encType = formPart.Method == "POST" ? formPart.EncType : string.Empty;
    var formContentTypeClassName = "form-" + ((string)Model.ContentItem.ContentType).HtmlClassify();
}

<form action="@formPart.Action" method="@formPart.Method"  enctype="@encType" class="form-content @formContentTypeClassName">
    @if(formPart.EnableAntiForgeryToken)
    {
        @Html.AntiForgeryToken()
    }

    @await DisplayAsync(Model.Metadata.ChildContent)
</form>
